package com.ynr.company.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ynr.company.service.ICompanyService;

@Controller
public class CompanyController {
	
	private static final Logger logger = LoggerFactory.getLogger(CompanyController.class);
	
	@Autowired
	private ICompanyService companyService;
	
	@RequestMapping("/getAllCompany")
	@ResponseBody
	public Map<String, Object> getAllCompany() {
		logger.debug("CompanyController method getAllCompany begin.");
		Map<String, Object> retMap = new HashMap<>();
		List<Map<String, String>> companyList = companyService.getAllCompany();
		retMap.put("data", companyList);
		return retMap;
	}
	
}
